#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 0, j = 0, num = 0;
	for (j = 1; j <= n; j++)
	{
		int ret = 1;
		for (i = 1; i <= j; i++)
		{
			ret *= i;
		}
		num += ret;
	}
	printf("%d\n", num);
	return 0;
}